//连接数据库
'use strict'
const Sequelize=require('sequelize');

//终端安装的包
//npm install sequelize;数据库
//npm install tedious;连接数据库

const sequelize=new  Sequelize('mssql','sa','123456',{
    host:'localhost',//本地服务器
    dialect:'mssql'//数据库名称
});

sequelize
    .authenticate()
    .then(()=>{
        console.log('数据库连接成功！！！');
    })
    .catch(err=>{
        console.log('数据库连接失败',err);
    });

    //暴露函数
    module.exports=sequelize;